home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / console / svgatext.3 / svgatext / SVGATextMode-1.3 / modedata.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-06  |  4.2 KB  |  97 lines

  1. /*  SVGATextMode -- An SVGA textmode manipulation/enhancement tool
  2.  *
  3.  *  Copyright (C) 1995,1996  Koen Gadeyne
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. /***
  21.  *** modedata: routines for text/graphics mode grabbing
  22.  ***/
  23.  
  24. #ifndef _MODEDATA_H
  25. #define _MODEDATA_H
  26.  
  27. #include "cfg_structs.h"
  28.  
  29. /* defines for text/graphics mode */ 
  30. #define MODE_UNDEFINED -1
  31. #define MODE_TEXT      0
  32. #define MODE_GRAPHICS  1
  33.  
  34. /* golden ratio limits: used for "smart" mode detection code -- they must NOT overlap! */
  35. #define GOLDEN_RATIO   1.333
  36.  
  37. /* defines for special mode flags */
  38. #define DOUBLESCAN     1<<0       /* doublescan bit on */
  39. #define CLOCKDIV2      1<<1       /* pixel clock is divided by 2 */
  40. #define MULTISCAN      1<<2       /* MSL>2 in graphics mode, used as extended DoubleScan */
  41. #define BYTEMODE       1<<3       /* byte mode memory adressing */
  42. #define WORDMODE       1<<4       /* word mode memory adressing */
  43. #define DOUBLEWORDMODE 1<<5       /* ... */
  44. #define VERT_DOUBLE    1<<6       /* vertical timings are doubled from the ones in the vert. timings regs */
  45. #define PCS_DIV2       1<<7       /* pixel data changes only every 2 pixel clock beats (256 color modes) */
  46. #define CNT_BY_2       1<<8       /* memory address counter increments only every 2nd pixel clock beat */
  47. #define INTERLACE      1<<9       /* interlacing enabled */
  48. #define SHIFT_CGA4C    1<<10      /* CGA 4-color 320x200 shift mode */
  49. #define SHIFT_CGA256C  1<<11      /* CGA 256 color 320x200 shift mode */
  50.  
  51.  
  52. /* special remarks concerning the grabbed mode */
  53. typedef struct {
  54.       int msg_mask;
  55.       char* msg_txt;
  56. } msg_str;
  57.  
  58. enum msg_type { MSG_VTIM_MOD                = 1<<0,
  59.                 MSG_HTIM_MOD                = 1<<1,
  60.                 MSG_GOLDENRATIO_X_CGA       = 1<<2,
  61.                 MSG_GOLDENRATIO_X_HICOLOR   = 1<<3,
  62.                 MSG_GOLDENRATIO_Y_INTERLACE = 1<<4,
  63.                 MSG_CLOCK_MEASUREMENTS      = 1<<5,
  64.                 MSG_INTERLACE               = 1<<6,
  65.                 MSG_BAD_HSYNC_STOP          = 1<<7,
  66.                 MSG_BAD_VSYNC_STOP          = 1<<8,
  67.                 MSG_PRESET_VTIM_MOD         = 1<<9,
  68.                 MSG_PRESET_HTIM_MOD         = 1<<10,
  69.                 MSG_PRESET_X_WRONG          = 1<<11,
  70.                 MSG_PRESET_Y_WRONG          = 1<<12,
  71.                 MSG_16BPP                   = 1<<13,
  72.                 MSG_24BPP                   = 1<<14,
  73.                 MSG_32BPP                   = 1<<15,
  74.                 MSG_IS_INTERLACE            = 1<<16,
  75.                 MSG_CGA                     = 1<<17,
  76.                 MSG_WEIRD                   = 1<<18,
  77.                 MSG_Y_WRAP_COMPENSATE       = 1<<19,
  78.                 MSG_CLOCKPROBE_FAILED       = 1<<20 };
  79.  
  80. typedef struct modestruct {
  81.       t_mode mode_line;                            /* basic data which would appear in a mode line */
  82.       int txt_gr_mode;                             /* text or graphics mode: MODE_TEXT or MODE_GRAPHICS */
  83.       int logical_width;                           /* screen width according to offset register */
  84.       int starthbl, endhbl, startvbl, endvbl;      /* blanking parameters */
  85.       int remarks;                                 /* special remarks concerning the grabbed mode */
  86.       int mode_flags;                              /* special mode flags -- should be merged with flags in mode_line */
  87.       int valid_measurements;                      /* percentage of valid measurements */
  88. } modestruct;
  89.  
  90. #define GMOFLG_SET(m,opt)    ((m).mode_flags |= (opt))
  91. #define GMOFLG_ISSET(m,opt)  ( ((m).mode_flags & (opt)) != 0 )
  92.  
  93. void getmode(modestruct* m, bool probe_clock, bool raw_mode, int initial_x, int initial_y);
  94.  
  95. #endif
  96.  
  97.